<?php

/**
 * @author christian
 * @copyright 2011
 *  
 * 
 **/

$ruta=$_SERVER['DOCUMENT_ROOT']."/viventura"."/MDGuide";
include_once("$ruta/star.php");
include_once("$ruta/MDTourGeneral/CTourEditDraw.php");


if (!isset($_POST['idTourTrack'])) {$_POST['idTourTrack'] = "NULL"; }
if (!isset($_POST['DateBegTrack'])) {$_POST['DateBegTrack'] = "NULL"; }
if (!isset($_POST['DateEndTrack'])) {$_POST['DateEndTrack'] = "NULL"; }


$idTourTrack = $_POST['idTourTrack'];
echo $idTourTrack."/";
$DateBegTrack = $_POST['DateBegTrack'];
echo $DateBegTrack."/";
$DateEndTrack = $_POST['DateEndTrack'];


$query = "UPDATE tour_has_track SET DateBegTrack = FROM_UNIXTIME($DateBegTrack), DateEndTrack= FROM_UNIXTIME($DateEndTrack) WHERE idTourTrack = $idTourTrack";
echo $query;
CModelo::getInstance()->insertData($query);


$idTour = CTourEditDraw::getInstance()->getAnyId("tour_has_track","idTourTrack",$idTourTrack,"tour_idTour");
echo $idTour;
echo "<script> parent.location.href = '/viventura/MDGuide/MDItinerary/MDEItinerary.php?codigo=$idTour' </script>";
  
?>